<template>
	<div class="dealSuc">
        <div class="dealTop">
            <div class="dealtitle">
                <img src="" alt="">
                <p>购买成功</p>
            </div>
            <div class="payPrice">
                <p>充值金额<span>{{price}}元</span></p>
                <p>支付方式<span>大钱SDK支付</span></p>
                <p>交易时间<span>{{gmData}}</span></p>
                <p>订单编号<span>DQ{{orderNo}}</span></p>
            </div>
        </div>
        <div class="cardpay_btn">
            <button class="complete" @click="recharge" autofocus="autofocus">完成</button>
        </div>
	</div>
</template>
<script>
	import { Cell, Panel,XInput,XButton,Card , CellFormPreview,FormPreview} from 'vux'
	export default {
		data (){
			return {
                orderNo:this.orderNo,
                gmData:this.gmData,
                price:this.price
                
			
			}
		},
		components: {
            FormPreview,
            Cell,
            XInput,
            XButton ,
			Card,
            Panel,
			CellFormPreview 
		},
        beforeCreate:function(){
            let xx = localStorage.getItem('sessionId');
            let out_order_no = localStorage.getItem('out_order_no');
            this.$http.post("http://192.168.100.106:8881/top/api/order/getUserOrderInfo",out_order_no,{headers: {userSessionId: xx    }}).then(function(res){
                if(res.body.returnCode == 0){
                    var a=res.body.returnValue;
                    this.cardValue=a;
                    this.show1=false;
                    this.show2=false;
                    this.showBg=false;
                    this.gmData = new Date(a.gmtCreate).toLocaleDateString();//购买时间
            
                    this.price=a.price;//可用余额
                    this.orderNo=a.orderNo
                }   
            },function(){
                alert('请求失败处理');   //失败处理
            })
        },
		methods: {
					
			saveData: function () {

	           let xx = 	{
					"sessionId":"ed852194-ceb9-4316-b3cb-ef972f96d233","cardProductInfo":{"state":"normal","name":"card1","price":"1200","quantity":"3000","expireDate":"360","denomination":"150000","cardType":"normal"}
	           }
	           this.$http.post("http://192.168.100.106:8881/top/api/order/getUserOrderInfo",xx).then(res => {
				console.log(res,"1111")
				}).then(err =>{
					console.error(err);
				})
			},
            recharge:function(){
                window.localStorage.setItem('qrcode',this.payCode);
                this.$router.push('/CardDetail')
        }
			
		}
	}
	</script>
<style>
    body{background:#efeff8;}
    .dealSuc .dealTop{background:#fff;}
    .dealSuc .dealtitle{display:block; text-align:center;padding:0; padding-top:6.7vh; font-size:0; width:93.6vw; margin:auto; border-bottom:1px dashed #c7c7cd;}
    .dealSuc .dealtitle img{display:inline-block;width:22.7vw;height:22.7vw; margin:0; border-radius:50%; overflow:hidden;} 
    .dealSuc .dealtitle p{line-height:6.7vh; font-size:4.4vw; margin:0; margin-bottom:5.3vw;}
    .dealSuc .payPrice{padding:0 3.2vw 3.3vh 3.2vw;}
    .dealSuc .payPrice p{height:4vw; font-size:4vw; line-height:4vw; margin-top:4.5vh;}
    .dealSuc .payPrice p span{float:right;}
    .dealSuc .weui-form-preview__item span{color:#000;}
    .dealSuc .cardpay_btn{text-align:center;}
    .dealSuc .complete{display:inline-block; width:93.6vw; margin-top:4.5vh; background:#fff; border-radius:1.4vw; font-size:4.5vw; color:#b49436; border:0; line-height:12vw;}
    

</style>
